package com.yonyou.pmclouds.altercategory.mapper;

import com.yonyou.pmclouds.altercategory.entity.AlterCategoryVO;
import com.yonyou.pmclouds.basecom.dao.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface AlterCategoryMapper extends BaseMapper<AlterCategoryVO> {
    @Select("select count(*) from pm_altercategory where pk_tenant = #{pkTenant} and sname = #{sname} and dr = 0 ")
    int countName(@Param("pkTenant") String pkTenant, @Param("sname") String sname);
    @Select("select count(*) from pm_altercategory where pk_tenant = #{pkTenant} and scode = #{scode} and dr = 0 ")
    int countCode(@Param("pkTenant") String pkTenant, @Param("scode") String sname);

    @Select("select * from pm_altercategory where pk_tenant = #{pkTenant} and dr = 0 order by creationtime asc")
    AlterCategoryVO[] getAllAlterCategory(@Param("pkTenant") String pkTenant);

    int countChild(String pkParent);

    AlterCategoryVO[] queryByIds(String[] ids);
}
